package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.dao.cxkcselectDaocy;
import com.zr.daoImpl.cxkcselectDaoImplcy;
import com.zr.model.User;

import net.sf.json.JSONArray;

public class cxkcselectControllercy extends HttpServlet {
		cxkcselectDaocy p=new cxkcselectDaoImplcy();
		@Override
		protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			doPost(req, resp);
		}
		@Override
		protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 		resp.setCharacterEncoding("utf8");
 		PrintWriter pw =resp.getWriter();
 		HttpSession session=req.getSession();
 		User us=(User)session.getAttribute("User");
 		int uid=us.getUid();
 		JSONArray js=p.getcxkcselect(uid);
 		pw.write(js.toString()); 			
		}
}
